<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%  
    session.setAttribute("test1Session","test1Session");  
    session.getServletContext().setAttribute("t1_session",session);  
    out.println("Application /test1 is ok!<br>");  
      
    if(session.getServletContext().getContext("/MineDemoSession")!=null){  
        HttpSession t2_session = (HttpSession)session.getServletContext().getContext("/MineDemoSession").getAttribute("t2_session");  
        if(t2_session!=null){  
            String str = (String)t2_session.getAttribute("test2Session");  
            String path = request.getContextPath();  
            out.println("Application "+path +":"+str+"<br>");  
        }else{  
            out.println("Application /test2 no data!");  
        }  
    }  
%> 
</body>
</html>